package Homework;

public class Minus<T extends Number> {
    private T num1;
    private T num2;

    // 两个数的减法
    public <L extends Number> double getResult(L num1, L num2) {
        return this.num1.doubleValue() - this.num2.doubleValue();
    }

    public Minus(T num1, T num2) {
        this.num1 = num1;
        this.num2 = num2;
    }

    public Minus( ) {
        this.num1 = null;
        this.num2 = null;

    }

    public T getNum1() {
        return num1;
    }

    public void setNum1(T num1) {
        this.num1 = num1;
    }

    public T getNum2() {
        return num2;
    }

    public void setNum2(T num2) {
        this.num2 = num2;
    }
}